The Building Blocks of a Central Application
Table of Contents
Sending a Blast
A blast lets you share data among different Central applications. The data
has to be of a specified standard format so that it can be understood across
the board. The sample application sends a zip code blast when a user clicks
the "blast
it" button. The onRelease handler on the button contains
the following code:
// create address object
myAddress = {};
// get zip code from input text field
myAddress.postalCode = zipcode_txt.text;
myAddress.country = "USA";
// create SelectedItem object
var addressSI = new SelectedItem("http://download.macromedia.com/pub/central/schemas/CentralData.xsd", "address");
addressSI.address = myAddress;
// setSelectedItem
dataArray = new Array(addressSI);
vShell.setSelectedItem(dataArray, "You blasted a zip code!");
First, you create an object (myAddress) to hold the data
you want to blast. Then you create a SelectedItem object
of type address, as defined by the address schema on the
Macromedia website (at http://download.macromedia.com/pub/central/schemas/CentralData.xsd)
After calling setSelectedItem(), a clickable blast icon
will appear in the lower right corner of the console when you click
the "blast it" button.
Figure 3. Sample blast